package com.wechatmall.api.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wechatmall.api.dao.OrderItemsMapper;
import com.wechatmall.api.pojo.dto.PageDto;
import com.wechatmall.api.pojo.entity.OrderItems;
import com.wechatmall.api.pojo.entity.Orders;
import com.wechatmall.api.dao.OrdersMapper;
import com.wechatmall.api.pojo.vo.OrdersVo;
import com.wechatmall.api.service.IOrdersService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zpc
 * @since 2025-09-24 02:24:13
 */
@Service
public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, Orders> implements IOrdersService {
    @Autowired
    private OrdersMapper ordersMapper;

    @Override
    public PageDto<OrdersVo> getOrderItemsByPage(Page<Orders> page) {
        return  PageDto.of(ordersMapper.getOrderItems(page), OrdersVo.class);
    }
}
